part of 'bloc.dart';

class PronunciationSettingsPageBlocState {
  const PronunciationSettingsPageBlocState({
    required this.voice,
    required this.pronunciationSettings,
    required this.availableAmVoices,
    required this.availableBrVoices,
    required this.normalizedSpeechRate,
  });

  final TtsVoice? voice;
  final PronunciationSettings pronunciationSettings;
  final BuiltList<TtsVoice> availableAmVoices;
  final BuiltList<TtsVoice> availableBrVoices;
  final double normalizedSpeechRate;

  PronunciationSettingsPageBlocState copyWith({
    TtsVoice? Function()? voice,
    PronunciationSettings Function()? pronunciationSettings,
    BuiltList<TtsVoice> Function()? availableAmVoices,
    BuiltList<TtsVoice> Function()? availableBrVoices,
    double Function()? normalizedSpeechRate,
  }) {
    return PronunciationSettingsPageBlocState(
      voice: voice == null ? this.voice : voice(),
      pronunciationSettings:
          pronunciationSettings == null ? this.pronunciationSettings : pronunciationSettings(),
      availableAmVoices: availableAmVoices == null ? this.availableAmVoices : availableAmVoices(),
      availableBrVoices: availableBrVoices == null ? this.availableBrVoices : availableBrVoices(),
      normalizedSpeechRate:
          normalizedSpeechRate == null ? this.normalizedSpeechRate : normalizedSpeechRate(),
    );
  }
}
